package com.owc.domain.dto.admin;

import com.owc.common.converter.OutputConverter;
import com.owc.common.enums.CallbackTypeEnum;
import com.owc.common.tool.UtilsService;
import com.owc.domain.entity.DrawFlow;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Author xiaom
 * @Date 2019/12/24 15:33
 * @Version 1.0.0
 * @Description <>
 **/
@NoArgsConstructor
@Data
public class DrawDetailDTO {

    private DetailBean detail;
    private ChainBean chain;
    private List<FlowsBean> flowList;

    @NoArgsConstructor
    @Data
    public static class DetailBean implements OutputConverter<DetailBean, DrawFlow> {
        private Long userId;
        private String phone;
        private String commitTime;
        private String operUser;
        private String type;
        private String tokenName;
        private BigDecimal drawoutAmount;
        private Integer status;

        @Override
        public void customConverter(DetailBean detailBean, DrawFlow drawFlow) {
            detailBean.setType(UtilsService.judgeDrawType(drawFlow.getType()));
            detailBean.setUserId(drawFlow.getOperAccountId());
        }
    }
}
